<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	request.setAttribute("basePath",basePath);
%>
<%@ include file="/resources/js/easyui/taglibs.jsp"%>
<%@ include file="/resources/js/wechat/_wechatui.jsp"%>
<%@ include file="/resources/js/easyui/_viewJS.jsp"%>
<!DOCTYPE>
<html>
<head>
	<title>场地账目</title>
</head>
<body>
<div class="loading"></div>
<!-- header -->
<header>
	<a href="javascript:history.go(-1);" class="top_fh">${placeName}</a>
	<a href="JavaScript:;" class="top_add"></a>
	<a href="${basePath}wechat/operate/search/searchAccountView" class="top_search"></a>
</header>
<!-- header end -->

<div class="page zhangmu_page">
	<c:choose>
		<c:when test="${!empty detailStatisticsDto}">
			<div class="zm_topsy">
				<em>
					<fmt:formatNumber pattern="#,###0.00"
				  		value="${empty detailStatisticsDto?0:detailStatisticsDto.coinmoney+detailStatisticsDto.billmoney+
				  		detailStatisticsDto.wechatmoney/100+detailStatisticsDto.alipaymoney/100}" />
				</em>
				<p>(今日收益/元)</p>
			</div>
			<div class="zm_syxq">
				<ul>
					<li>现金:${detailStatisticsDto.billmoney==null?'0':detailStatisticsDto.billmoney}</li>
					<li>一元硬币:${detailStatisticsDto.coinmoney==null?'0':detailStatisticsDto.coinmoney}</li>
					<li>微信:
						<fmt:formatNumber pattern="#,###0.00"
					  		value="${detailStatisticsDto.wechatmoney==null?'0':detailStatisticsDto.wechatmoney/100}" />
					</li>
					<li>支付宝:
						<fmt:formatNumber pattern="#,###0.00"
					  		value="${detailStatisticsDto.alipaymoney==null?'0':detailStatisticsDto.alipaymoney/100}" />
					</li>
					<li>游戏币:${detailStatisticsDto.gamecoinbalnce==null?'0':detailStatisticsDto.gamecoinbalnce}</li>
					<li>出币:${detailStatisticsDto.coinbalance==null?'0':detailStatisticsDto.coinbalance}</li>
					<li>出礼品:${detailStatisticsDto.giftbalance==null?'0':detailStatisticsDto.giftbalance}</li>
					<li>远程补币:${detailStatisticsDto.intdata1==null?'0':detailStatisticsDto.intdata1}</li>
				</ul>
			</div>
		</c:when>
		<c:otherwise>
			<div class="zm_topsy">
				<em>0</em>
				<p>(今日收益/元)</p>
			</div>
			<div class="zm_syxq">
				<ul>
					<li>现金:0</li>
					<li>一元硬币:0</li>
					<li>微信:0</li>
					<li>支付宝:0</li>
					<li>游戏币:0</li>
					<li>出币:0</li>
					<li>出礼品:0</li>
					<li>远程补币:0</li>
				</ul>
			</div>
		</c:otherwise>
	</c:choose>

	<div class="zm_sytab">
		<i></i>
		<c:choose>
			<c:when test="${!empty incomeDetail.get(0)}">
				<div>
					<em>本周收益</em>
					<p>
						<fmt:formatNumber pattern="#,###0.00"
					  		value="${incomeDetail.get(0)!=null?incomeDetail.get(0)/100:0}" />
					<span>（元）</span></p>
				</div>
				<div>
					<em>本月收益</em>
					<p>
						<fmt:formatNumber pattern="#,###0.00"
					  		value="${incomeDetail.size()>1?incomeDetail.get(1)/100:incomeDetail.get(0)/100}" />
					<span>（元）</span></p>
				</div>
			</c:when>
			<c:otherwise>
				<div>
					<em>本周收益</em>
					<p>0<span>（元）</span></p>
				</div>
				<div>
					<em>本月收益</em>
					<p>0<span>（元）</span></p>
				</div>
			</c:otherwise>
		</c:choose>
	</div>

   <!-- 兑换机 -->
    <div class="zm_duihuanj">
        <ul>
            <c:forEach items="${deviceList}" var="device">
                <li>
                    <a id="${device.deviceId}" class="CG_device_account" placeid="${device.placeId}" href="javascript:void(0);">
                        <p>${device.dtName}</p>
                        <span><font>${device.address}</font><font style="margin-left: 8px;">${device.deviceName}</font></span>
                    </a>
                </li>
            </c:forEach>
        </ul>
    </div>
    <!-- 兑换机 end -->
</div>

<!-- footer -->
<%@include file="/WEB-INF/jsp/wechat/_footer.jsp" %>
<!-- footer end -->

<!-- top加号弹窗 -->
<%@include file="/WEB-INF/jsp/wechat/_top.jsp" %>
<!-- top加号弹窗 end -->
</body>
</html>
<script>

    $(".CG_device_account").click(function () {
		var placeid = $(this).attr("placeid");
		if(typeof(placeid) == "undefined" || "" == placeid ){
			alert("非法请求，请刷新重试。");
		}else{
			var deviceinfo = $(this).children("span").children("font");
			var placename = encodeURI(encodeURI(deviceinfo.eq(0).text()));
			var devicename = encodeURI(encodeURI(deviceinfo.eq(1).text()));
			var devciceSerial = $(this).attr("id");
			window.location.href = '${basePath}wechat/income/accounts/'+ placeid +'/thatdayaccount?placeName=' + placename + "&deviceSerial=" + devciceSerial + "&deviceName="+devicename+"&statisticDate=";
		}


    });

</script>